<?php
/*   Description  of this file
*    Author king-of-war
*    Last Modified 2009-4-8
*    This class designed  for the news operation
*/
$root_path='./';
include_once $root_path.'head.php';
include_once $root_path."smart.inc.php";
include_once $root_path . 'admin/class/fun_common.php';
include_once $root_path . 'admin/class/guest.class.php';
include_once $root_path . 'admin/class/cfg.class.php';

/*
 * get page_num
 */
$cfg=new cfg($root_path);
  $page_size=$cfg->xml_read('page_num');


$fun = new fun_common($root_path);

$max = $fun->getAll('guest_book', 1);
/*
 * page moudle start
 *
 */
if (!empty ($_GET['p'])) {
	$page = $_GET['p'];
} else {
	$page = 1;
}
$pages = $fun->page($page, $page_size, $max);
/*
 * page moulde  end
 *
 *  sort_read($arr)
  */

$arr[0] = $pages['start'];
$arr[1] =  $page_size;
/*
 * get the comment of guests
 */
 $guest=new guest($root_path);

$guests=$guest->guest_read($arr,0);


/*
*  set templates
*/
$temp_url=$temp_url;
$smarty->assign("pages",$pages);
$smarty->assign("guest",$guests);
$smarty->assign("url",$temp_url);
$smarty->display("guests.html");

include_once  "foot.php";

?>